package com.whmnx.main.ui.adapter;

import android.widget.ImageView;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;
import com.whmnx.main.R;

/**
 * author : huang
 * date   : 2020/10/13 0013 15:33
 * version: 1.0
 * @author Administrator
 */
public  class ImageViewAdapter {
    @BindingAdapter("android:src")
    public static void setSrc(ImageView view, int resId) {
        view.setImageResource(resId);
    }


    @BindingAdapter("imageUrl")
    public static void setSrc(ImageView imageView, String url) {
        Glide.with(imageView.getContext()).load(url)
                .into(imageView);
    }

}
